The present invention relates to computer technology and more specifically to processing a database table.
Database software often needs to perform multi-dimensional processing on a database table. For example, consider the following SQL statements:
code 1SELECT C2FROM T1WHERE C1 IN (1, 5, 7, 9)ORDER BY C2FETCH FIRST 4 ROWS ONLY
Wherein, T1 is name of a table which includes at least two columns, i.e. C1 and C2. The above statements are for processing acquired data of T1 in two dimensions, that is, C1 and C2. Specifically, the above statements select those rows in which values of C1 are 1, 5, 7 or 9 from T1, sort these rows based on values of C2 in these rows and, finally, fetch the first 4 rows. It can be seen that the above statements not only cause processing on column C1, but also on column C2. In this manner, the SQL statements provide two-dimensional processing.
Assume T1 is as shown in FIG. 2, wherein grey part represents actual content of T1. The above statements select the 1st, 5th, 7th, 9th, 11th, 15th, 17th, 19th rows from T1. Values of C2 in these rows are 43, 34, 55, 23, 76, 23, 65, 54 respectively, which are sorted in descending order as 76, 65, 55, 54, 43, 34, 23, 23. Thus the finally fetched rows are the 11th, 17th, 9th, 19th rows.